\(\int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx\) [145]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 15 \[ \int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos ^4(a+b x)}{2 b} \]

[Out]

-1/2*cos(b*x+a)^4/b

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4372, 2645, 30} \[ \int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos ^4(a+b x)}{2 b} \]

[In]

Int[Cos[a + b*x]^2*Sin[2*a + 2*b*x],x]

[Out]

-1/2*Cos[a + b*x]^4/b

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2645

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(a*f)^(-1), Subst[
Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2]
 &&  !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])

Rule 4372

Int[(cos[(a_.) + (b_.)*(x_)]*(e_.))^(m_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/e^p, Int[(e*Cos
[a + b*x])^(m + p)*Sin[a + b*x]^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = 2 \int \cos ^3(a+b x) \sin (a+b x) \, dx \\ & = -\frac {2 \text {Subst}\left (\int x^3 \, dx,x,\cos (a+b x)\right )}{b} \\ & = -\frac {\cos ^4(a+b x)}{2 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos ^4(a+b x)}{2 b} \]

[In]

Integrate[Cos[a + b*x]^2*Sin[2*a + 2*b*x],x]

[Out]

-1/2*Cos[a + b*x]^4/b

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(29\) vs. \(2(13)=26\).

Time = 0.35 (sec) , antiderivative size = 30, normalized size of antiderivative = 2.00

method result size
default \(-\frac {\cos \left (2 x b +2 a \right )}{4 b}-\frac {\cos \left (4 x b +4 a \right )}{16 b}\) \(30\)
risch \(-\frac {\cos \left (2 x b +2 a \right )}{4 b}-\frac {\cos \left (4 x b +4 a \right )}{16 b}\) \(30\)
parallelrisch \(\frac {\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{4} \tan \left (x b +a \right ) x b +\left (-2 \tan \left (x b +a \right )^{2} x b +2 x b -6 \tan \left (x b +a \right )\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3}+\left (-6 \tan \left (x b +a \right ) x b +4 \tan \left (x b +a \right )^{2}-4\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}+\left (2 \tan \left (x b +a \right )^{2} x b -2 x b +6 \tan \left (x b +a \right )\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )+\tan \left (x b +a \right ) x b}{2 b \left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )^{2} \left (1+\tan \left (x b +a \right )^{2}\right )}\) \(169\)
norman \(\frac {x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3}+x \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (x b +a \right )^{2}+\frac {3 \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (x b +a \right )}{b}-x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )+\frac {x \tan \left (x b +a \right )}{2}-3 x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (x b +a \right )-x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3} \tan \left (x b +a \right )^{2}+\frac {x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{4} \tan \left (x b +a \right )}{2}-\frac {2 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}{b}+\frac {2 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (x b +a \right )^{2}}{b}-\frac {3 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3} \tan \left (x b +a \right )}{b}}{\left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )^{2} \left (1+\tan \left (x b +a \right )^{2}\right )}\) \(227\)

[In]

int(cos(b*x+a)^2*sin(2*b*x+2*a),x,method=_RETURNVERBOSE)

[Out]

-1/4*cos(2*b*x+2*a)/b-1/16*cos(4*b*x+4*a)/b

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos \left (b x + a\right )^{4}}{2 \, b} \]

[In]

integrate(cos(b*x+a)^2*sin(2*b*x+2*a),x, algorithm="fricas")

[Out]

-1/2*cos(b*x + a)^4/b

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 133 vs. \(2 (12) = 24\).

Time = 0.37 (sec) , antiderivative size = 133, normalized size of antiderivative = 8.87 \[ \int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx=\begin {cases} - \frac {x \sin ^{2}{\left (a + b x \right )} \sin {\left (2 a + 2 b x \right )}}{4} - \frac {x \sin {\left (a + b x \right )} \cos {\left (a + b x \right )} \cos {\left (2 a + 2 b x \right )}}{2} + \frac {x \sin {\left (2 a + 2 b x \right )} \cos ^{2}{\left (a + b x \right )}}{4} - \frac {\sin ^{2}{\left (a + b x \right )} \cos {\left (2 a + 2 b x \right )}}{2 b} + \frac {3 \sin {\left (a + b x \right )} \sin {\left (2 a + 2 b x \right )} \cos {\left (a + b x \right )}}{4 b} & \text {for}\: b \neq 0 \\x \sin {\left (2 a \right )} \cos ^{2}{\left (a \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(b*x+a)**2*sin(2*b*x+2*a),x)

[Out]

Piecewise((-x*sin(a + b*x)**2*sin(2*a + 2*b*x)/4 - x*sin(a + b*x)*cos(a + b*x)*cos(2*a + 2*b*x)/2 + x*sin(2*a
+ 2*b*x)*cos(a + b*x)**2/4 - sin(a + b*x)**2*cos(2*a + 2*b*x)/(2*b) + 3*sin(a + b*x)*sin(2*a + 2*b*x)*cos(a +
b*x)/(4*b), Ne(b, 0)), (x*sin(2*a)*cos(a)**2, True))

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.73 \[ \int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos \left (4 \, b x + 4 \, a\right ) + 4 \, \cos \left (2 \, b x + 2 \, a\right )}{16 \, b} \]

[In]

integrate(cos(b*x+a)^2*sin(2*b*x+2*a),x, algorithm="maxima")

[Out]

-1/16*(cos(4*b*x + 4*a) + 4*cos(2*b*x + 2*a))/b

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos \left (b x + a\right )^{4}}{2 \, b} \]

[In]

integrate(cos(b*x+a)^2*sin(2*b*x+2*a),x, algorithm="giac")

[Out]

-1/2*cos(b*x + a)^4/b

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \cos ^2(a+b x) \sin (2 a+2 b x) \, dx=-\frac {{\cos \left (a+b\,x\right )}^4}{2\,b} \]

[In]

int(cos(a + b*x)^2*sin(2*a + 2*b*x),x)

[Out]

-cos(a + b*x)^4/(2*b)